package com.application;

import javax.sql.DataSource;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Profile;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.application.bean.MenuConfigProperty;
import com.application.configuration.Modul;
@SpringBootApplication
@MapperScan(basePackages={"com.application.mybatis"})
@EnableWebSecurity
@EnableTransactionManagement
@EnableConfigurationProperties(value={MenuConfigProperty.class})
public class ApplicationStart {
	public static void main(String[] args) {
		SpringApplication sa = new SpringApplication(ApplicationStart.class);
		sa.setBannerMode(Mode.OFF);
		sa.run(args);
	}
	@Bean
	public Object gettransaction(PlatformTransactionManager p){
		System.err.println(p.getClass().getName());
		return p;
	}
	@Bean
	public PlatformTransactionManager datasourceTransAction(DataSource dataSource){
		return new DataSourceTransactionManager(dataSource);
	}
}
